<style scoped>
.content{
    padding: 50px 0;
    width: 90%;
    margin: auto;
}
</style>
<template>
    <div class="content">

        
      <Tabs value="jy" @on-click="switchTap" :animated="false">
          <TabPane label='救援列表' name='jy' >
               <Jy 
                v-if='current === "jy"'
                :orderList='orderList'
                :companyList='companyList'
                :carTeamList='carTeamList'  
                />
          </TabPane>
          <TabPane label='放空列表' name='fk' >
               <Fk 
                v-if='current === "fk"'
                :orderList='orderList'
                :companyList='companyList'
                :carTeamList='carTeamList'
                />
          </TabPane>
      </Tabs>
      
    </div>
</template>
<script>
import Jy from "./jy";
import Fk from './fk'
import * as API from './api'





// const tabConf = {

//     jy: {
//         name: 'jy',
//         label: '救援列表',
//         cmp: Jy,
//     },
//     fk: {
//         name: 'fk',
//         label: '放空列表',
//         cmp: Fk,
//     },
    
// }

export default {

    components:{
        Jy,
        Fk
    },
    
    data(){
        return {
            current: 'jy',
            orderList: [],
            companyList: [],
            carTeamList: [],
        }
    },

    methods: {

        switchTap(val){
            this.current = val
        },

        loadOrderOptions: API.loadOptionsWrap('orderList', API.getOrderAllStatus),
        loadCompaynListOptions: API.loadOptionsWrap('companyList', API.getInsureListList),
        loadCarTeamOptions: API.loadOptionsWrap('carTeamList', API.getCarTeamCompany),
    },
    created() {
        const {
            loadOrderOptions,
            loadCompaynListOptions,
            loadCarTeamOptions,
        } = this

        loadOrderOptions()
        loadCompaynListOptions()
        loadCarTeamOptions()
        
    },
    
}
</script>

